﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WCrawlerLib;

namespace WCrawler
{
    public partial class frmAccount : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //enable javascript
            //this.Page.Header.DataBind();

            if (!Page.IsPostBack)
            {
                gridViewAccount.DataBind();
                gridViewAccount.SelectedIndex = 0;
                gridViewAccount_SelectedIndexChanged(null, null);
            }
        }

        protected void AccountDetailsViewLinqDataSource_Selecting(object sender, LinqDataSourceSelectEventArgs e)
        {
            WCrawlerLib.Account obj = new WCrawlerLib.Account();
            e.Result = obj.GetAccount((int)gridViewAccount.SelectedDataKey["AccountId"]);
        }

        protected void gridViewAccount_SelectedIndexChanged(object sender, EventArgs e)
        {
            detailsViewAccount.DataBind();
        }
    }
}